<?php

namespace App\Http\Controllers\Front;

use App\Common\Controllers\Front\FrontController;
use App\Services\LetterService;
use Illuminate\Http\Request;

class LetterController extends FrontController
{
    /**
     * constructor.
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * @param Request $request
     * @return mixed
     * @throws \App\Common\Tools\CustomException
     * 创建
     */
    public function create(Request $request){
        $data = $request->post();
        $letterService = new LetterService();
        $ret = $letterService->create($data);

        return $this->ret($ret, $letterService->getModel());
    }
}
